<?php
/**
 * Created by PhpStorm.
 * User: Administrator
 * Date: 2018\9\26 0026
 * Time: 13:48
 */

namespace app\Lib\Model\Tag;


use app\Lib\InterfaceIn\User\UserHandle;
use app\Lib\Model\DbModel\StyleTag;

abstract class TagBase implements \app\Lib\InterfaceIn\Tag\TagBase
{
    /** @var UserHandle $opUser */
    protected $opUser;
    protected $tagName;
    protected $imgId;
    /**
     * 设置操作人
     * @param UserHandle $opUser
     * @return \app\Lib\InterfaceIn\Tag\TagBase
     */
    public function setOpUser(UserHandle $opUser)
    {
        $this->opUser = $opUser;
        return $this;
    }

    /**
     * 设置标签名称
     * @param $TagName
     * @return \app\Lib\InterfaceIn\Tag\TagBase
     */
    public function setTagName($TagName)
    {
        $this->tagName = $TagName;
        return $this;
    }

    /**
     * 设置标签图片
     * @param $ImgId
     * @return \app\Lib\InterfaceIn\Tag\TagBase
     */
    public function setImgId($ImgId)
    {
        $this->imgId = $ImgId;
        return $this;
    }


    protected function handleData(){
        $model  = (new StyleTag());
        $data   =[
            $model->_tag_name => $this->tagName,
            $model->_img_id   => $this->imgId,
        ];

        return $data;
    }

}